#include <iostream>
#include "ListCpp.h"


int main()
{
    ListCpp<int> list;

    ListCpp<int> clist;

    ListCpp<int>::CLIter cit = clist.Begin();

    for(int i=0;i<100;i++)
    {
        int *j = new int(i);
        try
        {
            list.Insert(list.Begin(),j);
        }
        catch(ListCpp<int>::ErrList& _err)
        {
            std::cout<<"err is "<<_err.what()<<std::endl;
        }
    }

    ListCpp<int>::LIter it = list.Begin();

    for ( ; it != list.End() ;++it )
    {
       std::cout<<" data is<"<<*(it.Get())<<">"<<std::endl;
    }


   clist = list = list;


    cit = clist.Begin();

    for ( ; cit != clist.End() ;++cit )
    {
       std::cout<<"data is<"<<*(cit.Get())<<">"<<std::endl;
    }

    while(!clist.IsEmpty())
    {
        clist.Remove(clist.Begin());
    }

    try
    {
        clist.Remove(clist.Begin());
    }
    catch(...)
    {

    }

    return 0;
}
